package com.netty.kkk.mapper;

import com.netty.kkk.vo.ChatInfo;
import com.netty.kkk.vo.MessageRecord;
import com.netty.kkk.vo.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ChatMapper {
    List<ChatInfo> listChat(String userName);
    ChatInfo getChatInfoById(String chatId);
    List<UserInfo> getMemberById(String chatId);
    void recordMsg(MessageRecord messageRecord);
    List<MessageRecord> getMsgRecorder(String groupId, int start, int num);//times:第几次请求历史记录，num:一次返回多少条记录
    void deleteChat(String chatId);
    void quitChat(String chatId, String userId);
    void changeChatName(String chatId, String chatName);
    int createNewChat(ChatInfo chatInfo);
    void insertMembers(int chatId, List<String> memberList);
}
